﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Collections;

namespace RatpConsole
{
    class ProbeRefreshWorker
    {
        private int timerTick;
        public int getTimerTick()
        {
            return timerTick;
        }
        public void setTimerTick(int timerTick)
        {
            this.timerTick = timerTick;
        }
        public ProbeRefreshWorker(int timerTick)
        {
            this.timerTick = timerTick;
        }

        public void ThreadLoop()
        {
            while (Thread.CurrentThread.IsAlive)
            {
                Thread.Sleep(timerTick);
                ArrayList probes = ProbeManager.getInstance().listProbes();
                foreach ( Probe probe in probes)
                {
                    probe.refresh();
                }
            }
        }

    }
}
